{% extends 'myadmin/base.html' %}

{% block title %}
<title>图书分类添加</title>
{% endblock %}

{% block content %}
  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">图书分类添加</strong> / <small>Book classification add</small></div>
      </div>

      <hr/>

      <div class="am-g">

        <div class="am-u-sm-5 am-u-md-5 am-u-md-pull-12">
          <!-- 表单上传 -->
          <form class="am-form am-form-horizontal" action="{% url 'myadmin_type_add' %}" method="post" enctype="multipart/form-data">
            {% csrf_token %}

            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">*所属类别</div>
              <div class="am-u-sm-8 am-u-md-9">
                <select name="pid" data-am-selected="{btnSize: 'sm'}">
                  <option value="0">顶级分类</option>
                  {% for i in type_data %}
                    <!-- 显示所有父级pid的id -->
                    <option value="{{ i.id }}">{{ i.sj }}{{ i.name }}</option>
                  {% endfor %}
                </select>
              </div>
            </div>

            <br>

            <div class="am-form-group">
              <label class="am-u-sm-3 am-form-label">*分类名</label>
              <div class="am-u-sm-9">
                <input type="text" name="name" required placeholder="分类名">
                <small>必须填写</small>
              </div>
            </div>


            <div class="am-form-group">
              <div class="am-u-sm-9 am-u-sm-push-3">
                <button type="submit" class="am-btn am-btn-primary">确认添加</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>

    <footer class="admin-content-footer">
      <hr>
      <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
    </footer>

  </div>
  <!-- content end -->
{% endblock %}